package cn.dyw.cloudmusic.http.model;

import cn.dyw.cloudmusic.config.ParamsConfig;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

/**
 * @author: dyw770
 * @Date: 2019/1/16 21:26
 * @Description: 搜索单曲
 */
@Data
public class SingleParams implements Params {

    @JSONField(name = "hlpretag")
    private String hlPreTag;

    @JSONField(name = "hlposttag")
    private String hlPostTag;

    private String s;

    private int type;

    private int offset;

    private boolean total;

    private int limit;

    @JSONField(name = "csrf_token")
    private String csrfToken;

    public SingleParams(String s) {
        this.hlPreTag = "<span class=\"s-fc7\">";
        this.hlPostTag = "</span>";
        this.s = s;
        this.type = 1;
        this.offset = 0;
        this.total = true;
        this.limit = 30;
    }

    public SingleParams(String s, int type) {
        this.hlPreTag = "<span class=\"s-fc7\">";
        this.hlPostTag = "</span>";
        this.s = s;
        this.type = type;
        this.offset = 0;
        this.total = true;
        this.limit = 30;
    }

    @Override
    public String songId() {
        return "502233258";
    }

    @Override
    public String requestUrl() {
        return ParamsConfig.search;
    }
}
